#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QMessageBox>
#include <QCloseEvent>
#include "videodecode.h"
#include "videothread.h"

namespace Ui {
class Widget;
}

class Widget : public QWidget
{
    Q_OBJECT

public:
    explicit Widget(QWidget *parent = nullptr);
    ~Widget();

protected:
    void closeEvent(QCloseEvent *event) override
    {
        event->accept();
        on_stopPushButton_clicked();
    }

private slots:
    void on_startPushButton_clicked();
    void on_stopPushButton_clicked();

    void SetImage(const QImage &image);

private:
    Ui::Widget *ui;
    VideoDecode *videoDecode; //私有成员变量
    VideoThread *videoThread;

};

#endif // WIDGET_H
